package com.hulytu.android.foundation.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import org.jetbrains.annotations.NotNull;


/**
 * @author Chris (hulytu@163.com)
 * @since 2021/11/3
 */
public abstract class AppActivity extends Activity {

    private int contentLayoutId;

    public AppActivity() {

    }

    protected AppActivity(int contentLayoutId) {
        this.contentLayoutId = contentLayoutId;
    }

    @Override
    protected void onCreate(@NotNull Bundle savedInstanceState) {
        Intent intent = getIntent();
        requestWindowFeature(intent);

        beforeOnCreate();

        initUltimateBarStyle();

        super.onCreate(savedInstanceState);
        if (contentLayoutId > 0) setContentView(contentLayoutId);

        doOnCreate(savedInstanceState);
    }

    protected void requestWindowFeature(Intent intent) {

    }

    protected void initUltimateBarStyle() {

    }

    protected void beforeOnCreate() {

    }

    protected void doOnCreate(Bundle bundle) {

    }
}
